package com.onpositive.simple.persistance;

public class RAMTreeNode extends AbstractTreeNode {
	
	private  RAMNodeStorage nodeStorage ;
	protected int offset;
	protected int index ;
	//protected int typeIndicatorBitsCount = 1 ;
	
	//public int getRecordsCount(){ return container[0] >> typeIndicatorBitsCount ; }
	//public int getType() { return container[0] & (( 1 << typeIndicatorBitsCount)-1 ) ; }
	//public int getType() { return container[0] & (( 1 << typeIndicatorBitsCount)-1 ) ; }
	
	

	public RAMTreeNode(RAMNodeStorage nodeStorage, int offset, int index) {
		super();
		this.nodeStorage = nodeStorage;
		this.offset = offset;
		this.index = index;
	}

	@Override
	public int getElement(int i) {
		return nodeStorage.container[ offset+i ] ;
	}

	@Override
	public void setElement(int i, int value) {
		nodeStorage.container[ offset+i ] = value ;
	}
	
	@Override
	public int getIndex(){ return index ; }
	
	@Override
	public void setIndex( int i){ index = i ; }

}
